/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.comac.ins.common.mybatis.core.mapper.BaseMapperPlus;
import com.comac.ins.isfd.domain.IsfdDatabaseModelConfig;
import com.comac.ins.isfd.domain.vo.IsfdDatabaseModelConfigVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 数据库建模配置Mapper接口
 *
 * @author lj
 * @date 2025-01-16
 */
@Mapper
public interface IsfdDatabaseModelConfigMapper extends BaseMapperPlus<IsfdDatabaseModelConfig, IsfdDatabaseModelConfigVo> {
    Long selectModelIdByParentFiledId(@Param("parentFieldId")Long parentFieldId);

    List<IsfdDatabaseModelConfigVo> selectModelByName(@Param("modelName")String modelName, @Param("startTime")Date startTime, @Param("endTime")Date endTime);

    List<IsfdDatabaseModelConfigVo> selectModelByRefId(@Param("refId")Long refId, @Param("startTime")Date startTime, @Param("endTime")Date endTime);
    List<IsfdDatabaseModelConfigVo> selectModelData(@Param("modelId")Long modelId);

    Page<IsfdDatabaseModelConfigVo> collectCardList(@Param("page") Page<IsfdDatabaseModelConfig> page,
                                      @Param(Constants.WRAPPER) Wrapper<IsfdDatabaseModelConfig> queryWrapper);

    IsfdDatabaseModelConfigVo selectByTableName(@Param("tableName")String tableName);

    IsfdDatabaseModelConfig selectModelByModelName(@Param("modelName")String modelName);
}
